{% extends "base.html" %}
{% block menu %}
	
  <div class="navbar navbar-inverse navbar-fixed-top">
      <div class="navbar-inner">
        <div class="container">
          <button type="button" class="btn btn-navbar" data-toggle="collapse" data-target=".nav-collapse">
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
            <span class="icon-bar"></span>
          </button>
          <a class="brand" href="#">Project Manager System</a>
          <div class="nav-collapse collapse">
            <ul class="nav">
              <li class="active"><a href="/admrol/{{session['faseid']}}">Administrar Rol</a></li>
              <li><a href="/">Logout</a></li>
              <li><a href="#contact">Usuario: {{session['username']}}</a></li>
              </ul>
          </div>
       </div>
     </div>
</div>
{%endblock%}


{%block content%}
<div class="container">
	<h3>Crear Rol en {{session['proyectonombre']}} - {{session['fasenombre']}} </h3>
	<hr>
	<p>Complete los datos del Rol:</p>
        <form action="{{url_for('crearrol')}}" method="post">
        <div class="span12">
            <p>Nombre<small class="text-error">(*)</small>:
            {%  with messages = get_flashed_messages(category_filter=["nombre"]) %}
	  			{% if messages %}
	  				{% for message in messages %}
   						<small class="text-error">{{ message }}</small>	
   					{% endfor %}    					
				{% endif %}
			{% endwith %}         
	    	<br/>
	    	<p><input type="text" name="nombre" value="{{session['aux']}}"/></p>
	    	</div>
	    	<div class="span4">
    		<p align="center">	<strong>Permisos sobre Tipo de Item</strong></p>	
			<table  class="table" >
	    	<tr class="info">
            {%if session['aux1'] == True %}
            	<td><input type="checkbox" name="crearT" checked />Crear</td>
            {%else%}
            	<td><input type="checkbox" name="crearT" />Crear</td>
            {%endif%}
            {%if session['aux2'] == True%}
            	<td><input type="checkbox" name="editarT" checked />Editar</td>
            {%else%}
            	<td><input type="checkbox" name="editarT" /> Editar</td>
            {%endif%}
            {%if session['aux3'] == True%}
            	<td><input type="checkbox" name="eliminarT" checked /> Eliminar</td> 
            {%else%}
            	<td><input type="checkbox" name="eliminarT" /> Eliminar</td> 
            {%endif%}
            </tr>
            </table>
            </div>
            <div class="span4">
            <p align="center"><strong>Permisos sobre Linea Base</strong></p>
            <table  class="table" >
            <tr class="error">
            {%if session['aux4'] == True%}
            	<td><input type="checkbox" name="crearLB" checked /> Crear</td>
            {%else%}
            	<td><input type="checkbox" name="crearLB" /> Crear</td>
            {%endif%}
            </tr>
            </table>
            </div>
            <br></br>
            <div class="span7" align="center">
            <p align="center"><strong>Permisos sobre Item</strong></p>
            <table  class="table" >
            <tr class="success">
            {%if session['aux6'] == True%}
            	<td><input type="checkbox" name="crearI" checked/> Crear</td>
            {%else%}
            	<td><input type="checkbox" name="crearI" /> Crear</td>
            {%endif%}
            {%if session['aux7'] == True%}
            	<td><input type="checkbox" name="editarI" checked /> Editar</td>
            {%else%}
            	<td><input type="checkbox" name="editarI" /> Editar</td>
            {%endif%}
            {%if session['aux8'] == True%}
            	<td><input type="checkbox" name="eliminarI" checked /> Eliminar</td>
            {%else%}
            	<td><input type="checkbox" name="eliminarI" /> Eliminar</td>
            {%endif%}
            </tr>
            <tr class="success">
            {%if session['aux9'] == True%}
            	<td><input type="checkbox" name="aprobarI" checked /> Aprobar</td>
            {%else%}
            	<td><input type="checkbox" name="aprobarI" /> Aprobar</td>
            {%endif%}
            {%if session['aux10'] == True%}
            	<td><input type="checkbox" name="revivirI" checked/>Revivir</td>
            {%else%}
            	<td><input type="checkbox" name="revivirI" />Revivir</td>
            {%endif%}
            {%if session['aux11'] == True%}
            	<td><input type="checkbox" name="reversionarI" checked/> Reversionar</td>
            {%else%}
            	<td><input type="checkbox" name="reversionarI" /> Reversionar</td>
            {%endif%}
            </tr>
            <tr class="success">
            {%if session['aux12'] == True%}
            	<td><input type="checkbox" name="asignarpadreI" checked /> Asignar Padre</td>
            {%else%}
            	<td><input type="checkbox" name="asignarpadreI" /> Asignar Padre</td>
            {%endif%}
            {%if session['aux13'] == True%}
            	<td><input type="checkbox" name="asignarantecesorI" checked/> Asignar Antecesor</td>
            {%else%}
            	<td><input type="checkbox" name="asignarantecesorI" /> Asignar Antecesor</td>
            {%endif%}
            <td></td>
            </tr>
            </table>
            
           </div>
           <div class="span7">
            <p><input class="btn btn-success" type="submit" value="Aceptar" />
            <a class="btn btn-inverse" href="/admrol/{{session['faseid']}}">Cancelar</a></p>
            </div>
        </form>
        
</div>
{%endblock%}
